{{!
  Copyright (c) HashiCorp, Inc.
  SPDX-License-Identifier: BUSL-1.1
~}}

{{! template-lint-disable no-inline-styles }}
<div class="boxed-section is-small">
  <div class="boxed-section-body inline-definitions">
    <span class="label" style="width: 6.125rem;">Job Details</span>
    <span class="pair" data-test-job-stat="type">
      <span class="term">Type</span>
      {{@job.type}}
    </span>
    <span class="pair" data-test-job-stat="priority">
      <span class="term">Priority</span>
      {{@job.priority}}
    </span>
    <span class="pair" data-test-job-stat="version">
      <span class="term">Version</span>
      {{@job.version}}
    </span>
    {{#if (and (can "list variables") @job.pathLinkedVariable)}}
      <span class="pair" data-test-job-stat="variables">
        <LinkTo @route="variables.variable" @model={{@job.pathLinkedVariable.id}}>Variables</LinkTo>
      </span>
    {{/if}}
    {{yield to="before-namespace"}}
    {{#if (and @job.namespace this.system.shouldShowNamespaces)}}
      <span class="pair" data-test-job-stat="namespace">
        <span class="term">Namespace</span>
        {{@job.namespace.name}}
      </span>
    {{/if}}
    <span class="pair" data-test-job-stat="node-pool">
      <span class="term">Node Pool</span>
      {{#if @job.nodePool}}{{@job.nodePool}}{{else}}-{{/if}}
    </span>
    {{yield to="after-namespace"}}
  </div>

  {{#if this.packDetails.name}}
    <div class="boxed-section-body inline-definitions">
      <span class="label" style="width: 6.125rem;">Pack Details</span>
      <span class="pair" data-test-pack-stat="name">
        <span class="term">Name</span>
        {{this.packDetails.name}}
      </span>
      {{#if this.packDetails.registry}}
        <span class="pair" data-test-pack-stat="registry">
          <span class="term">Registry</span>
          {{this.packDetails.registry}}
        </span>
      {{/if}}
      {{#if this.packDetails.version}}
        <span class="pair" data-test-pack-stat="version">
          <span class="term">Version</span>
          {{this.packDetails.version}}
        </span>
      {{/if}}
      {{#if this.packDetails.revision}}
        <span class="pair" data-test-pack-stat="revision">
          <span class="term">Revision</span>
          {{this.packDetails.revision}}
        </span>
      {{/if}}
      {{yield to="pack"}}
    </div>
  {{/if}}
</div>
